#include "Mortal.h"
#include <ctime>



Mortal::Mortal()
{ 
   creation_time_=time(0);
   estimated_life_duration_=-1;
}

int Mortal::get_creation_time()
{
	return creation_time_;
}
int Mortal::get_estimated_life_duration()
{  if( estimated_life_duration_==-1)
    {
		estimated_life_duration_=get_estimated_life_duration_();
    }


   return estimated_life_duration_;
}

bool Mortal::is_alive()
{
	return time(0)<creation_time_+get_estimated_life_duration();

}